local cjson = require "cjson"
local template = require("resty.template")

local _M = {}

-- 关于页面
function _M:index()
    local page = {}
    page.title = "王晋蜀的个人空间"
    page.description = "这里将深入探讨编程技术，包括linux, c, c++, rust等语言，vim，emacs, 架构设计等。:)"
	local about = {}
    local file = io.open (ngx.var.work_path .. '/html/blog/about.md', r)
    local s = file:read("*a")
    file:close()
    print(string.gsub(s, "`", "\\`"))
    about.content = string.gsub(s, "`", "\\`")
	local context = {page = page, about = about}
	template.render("blog/about.html", context)
end

return _M
